function [profit] = profit_Sh3s(pi,m,mu,p_g,p_m,p_b,lambda)

    p=mu(1)*p_g+mu(2)*p_m+mu(3)*p_b;
    np=1-p;
    
    gamma_g(1)=mu(1)*p_g/p;
    gamma_g(2)=mu(2)*p_m/p;
    gamma_g(3)=mu(3)*p_b/p;
    
    gamma_b(1)=mu(1)*(1-p_g)/np;
    gamma_b(2)=mu(2)*(1-p_m)/np;
    gamma_b(3)=mu(3)*(1-p_b)/np;
    
    profit=mu(1)*p_g*(pi(1)+m)+mu(2)*p_m*(pi(2)+m)+mu(3)*p_b*(pi(3)+m)-lambda*ShannonCost3s(mu,p,gamma_g,gamma_b);